<template>
  <div class="main_right_nav">
    <div class="main_right_nav_1">
      <div class="main_right_nav_1_publish">
        写文章
      </div>
      <div class="main_right_nav_1_button">
        <a-button @click="handleJump" type="primary" size="large">
          点击上传
        </a-button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import {message} from "ant-design-vue";
// @ts-ignore
import cookie from 'js-cookie'
import {useRouter} from "vue-router";
import {checkUserLogin} from "@/utils/getUser";

const router = useRouter()

//页面跳转
const handleJump = async () => {
  if (!await checkUserLogin()) {
    message.warn('未登录，无法上传')
  } else {
    await router.push("/writeArticle")
  }
}
</script>

<style lang="less" scoped>
.main_right_nav {
  background-color: #ffffff;
  margin-left: 10px;
  padding: 3px;

  .main_right_nav_1 {
    box-shadow: rgba(3, 102, 214, 0.3) 0 0 0 3px;
    padding: 10px;
    font-weight: bold;

    .main_right_nav_1_publish {
      text-align: center;
      font-size: 20px;
      border-bottom: 1px solid #f0f0f0;
    }

    .main_right_nav_1_button {
      text-align: center;
      padding: 30px;
    }
  }


}
</style>